using System;
using System.Collections.Generic;
using System.Text;
using System.Xml;

namespace miciv
{
    public interface IComponentPrototype
    {
        string ID { get; }
        IComponentManager Manager { get; }
        EntityPrototype Entity { get; }
        CoreContext CoreContext { get; }
        CoreManager CoreManager { get; }
        bool Initialize(EntityPrototype _enProto, XmlElement _xmlConfig, IComponentManager _coManager);
        void Release();
    }

    public interface IComponentInstance
    {
        string ID { get; }
        Entity Entity { get; }
        IComponentPrototype Prototype { get; }
        CoreContext CoreContext { get; }
        CoreManager CoreManager { get; }
        bool Initialize(Entity _entity, IComponentPrototype _coProto);
        void PostInitialize(XmlElement _xmlComponent);
        void Update(float _deltaTime);
        void Release();
    }

    public interface IComponentManager
    {
        List<string> AvailableComponentNames { get; }
        CoreContext CoreContext { get; }
        CoreManager CoreManager { get; }
        IComponentPrototype CreatePrototype(EntityPrototype _enProto, XmlElement _xmlConfig);
        void ReleasePrototype(IComponentPrototype _coProto);
        IComponentInstance CreateInstance(Entity _entity, IComponentPrototype _coProto);
        void ReleaseInstance(IComponentInstance _coInstance);
        void Release();
    }
}
